home *** CD-ROM | disk | FTP | other *** search
- /* ATalk.h Gijs Mos
- Header file for use with AppleTalk.
- © Copyright 1985 Gijs Mos
- 1986 Consulair Corp
- */
-
- #ifndef ABincluded
- #define ABincluded
-
- #ifndef MacdefsLoaded
- #include "MacDefs.h"
- #endif
-
- /* ABusRecord sizes */
-
- #define lapSize 20 /* LAP */
- #define ddpSize 26 /* DDP */
- #define nbpSize 26 /* NBP */
- #define atpSize 56 /* ATP */
-
- /* ABCallTypes */
-
- #define tLAPRead 0
- #define tLAPWrite 1
- #define tDDPRead 2
- #define tDDPWrite 3
- #define tNBPLookup 4
- #define tNBPConfirm 5
- #define tNBPRegister 6
- #define tATPSndRequest 7
- #define tATPGetRequest 8
- #define tATPSndRsp 9
- #define tATPAddRsp 10
- #define tATPRequest 11
- #define tATPResponse 12
-
- /* Applicable OSErrors */
-
- #define noErr 0 /* No error */
- #define ddpSktErr -91 /* DDP socket error */
- #define ddpLenErr -92 /* DDP datagram or LAP datalength too big */
- #define noBridgeErr -93 /* No bridge found */
- #define lapProtErr -94 /* Attach/Detach ALAP error */
- #define excessCollsns -95 /* No CTS after 32 RTS or in use 32 times */
- #define portInUse -97 /* Driver open. Port in use */
- #define portNotCf -98 /* Driver open. Port not configured */
- #define resNotFound -192 /* Resource not found */
- #define NBPBuffOvr -1024 /* Buffer overflow in LookupName */
- #define NBPNoConfirm -1025 /* Name not confirmed on ConfirmName */
- #define NBPConfDiff -1026 /* Name confirmed at different socket */
- #define NBPDuplicate -1027 /* Duplicate name exists already */
- #define NBPNotFound -1028 /* Name not found on remove */
- #define NBPNISErr -1029 /* Error trying to open the NIS */
- #define ReqFailed -1096 /* SendRequest failed: retry count exceeded */
- #define TooManyReqs -1097 /* Too many concurrent requests */
- #define TooManySkts -1098 /* Too many concurrent responding-sockets */
- #define BadATPSkt -1099 /* Bad ATP-responding socket */
- #define BadBuffNum -1100 /* Bad response buffer number specififed */
- #define NoRelErr -1101 /* No release received */
- #define CBNotFound -1102 /* Control Block (TCB or RspCB) not found */
- #define NoSendResp -1103 /* AddResponse issued without SendResponse */
- #define NoDataArea -1104 /* No data area for request to MPP */
- #define ReqAborted -1105 /* SendRequest aborted by RelTCB */
-
- struct LAPAdrBlock {
- char dstNodeID; /* destination node ID */
- char srcNodeID; /* source node ID */
- char LAPProtType; /* LAP protocol type */
- };
- typedef struct LAPAdrBlock LAPAdrBlock;
-
- struct Str32 {
- char str32Count; /* # of chars */
- char str32Cont[33]; /* string content+padding */
- };
- typedef struct Str32 Str32;
-
- struct EntityName {
- Str32 objStr; /* object */
- Str32 typeStr; /* Type */
- Str32 zoneStr; /* Zone */
- };
- typedef struct EntityName EntityName;
- typedef EntityName *EntityPtr;
-
- struct RetransType {
- char retransInterval; /* in 8 tick units */
- char retransCount; /* # of attempts */
- };
- typedef struct RetransType RetransType;
-
- typedef char BitMapType;
-
- struct BDSElement {
- short buffSize; /* buffer size in bytes */
- Ptr buffPtr; /* buffer pointer */
- short dataSize; /* packet size */
- long userBytes;
- };
- typedef struct BDSElement BDSElement;
-
- struct BDSType {
- BDSElement elements[7];
- };
- typedef struct BDSType BDSType;
- typedef BDSType *BDSPtr;
-
- struct AddrBlock {
- short aNet; /* network id */
- char aNode; /* node ID */
- char aSocket; /* socket number */
- };
- typedef struct AddrBlock AddrBlock;
-
- struct LapProto {
- LAPAdrBlock lapAddress; /* dest or src node id */
- short lapReqCount; /* length of frame data */
- /* or bufsize in bytes */
- short lapActCount; /* # frame data act. rec. */
- Ptr lapDataPtr; /* pointer to data */
- };
-
- struct DdpProto {
- short ddpType; /* DDP protocol type */
- short ddpSocket; /* source or rec socket */
- AddrBlock ddpAddress; /* dest or src address */
- short ddpReqCount; /* length of datagram
- or buffersize in bytes */
- short ddpActCount; /* no of bytes rec. */
- Ptr ddpDataPtr; /* buffer pointer */
- short ddpNodeID; /* original dest node ID */
- };
-
- struct NbpProto {
- EntityPtr nbpEntityPtr; /* ^to entityname */
- Ptr nbpBufPtr; /* ^to buffer */
- short nbpBufSize; /* buffer size in bytes */
- short nbpDataField; /* #addresses or socket # */
- AddrBlock nbpAddress; /* socket address */
- RetransType nbpRetransmitInfo; /* retransmission info */
- };
-
- struct AtpProto {
- short atpSocket; /* list. or resp. socket */
- AddrBlock atpAddress; /* dest. or src. sock. */
- short atpReqCount; /* buffer size */
- Ptr atpDataPtr; /* ponter to req. buffer */
- BDSPtr atpRspBDSPtr; /* pointer ro resp. BDS */
- BitMapType atpBitMap; /* transaction bitmap */
- short atpTransID; /* transaction ID */
- short atpActCount; /* bytes received */
- long atpUserData; /* user bytes */
- char atpXO; /* exactly once */
- char atpEOM; /* end of message */
- short atpTimeOut; /* retry TO (secs) */
- short atpRetries; /* # retries */
- short atpNumBufs; /* #buffers in BDS */
- short atpNumRsp; /* #responsees or seqnum */
- short atpBDSSize; /* #elems in resp BDS */
- long atpRspUData; /* user bytes send or rec */
- Ptr atpRspBuf; /* ptr to resp. buffer */
- short atpRspSize; /* size of atpRspBuf */
- };
-
-
- struct ABusRecord {
- short abOpcode; /* type of call */
- short abResult; /* result code */
- long abUserReference; /* for your use */
- union {
- struct LapProto lap; /* lap specifics */
- struct DdpProto ddp; /* ddp specifics */
- struct NbpProto nbp; /* nbp specifics */
- struct AtpProto atp; /* atp specifics */
- } p;
- };
- typedef struct ABusRecord ABusRecord;
- typedef ABusRecord *ABRecPtr;
- typedef ABRecPtr *ABRecHandle;
-
- #endif
-
-